<template>
  <div>
    <h1>计数器</h1>
    <div>{{count}}</div>
    <button @click="increment(2)">+mutations</button>
    <button @click="incrementAsync(3)">+actions</button>
  </div>
</template>

<script lang='ts'>
import {ref,reactive} from 'vue'
import {createNamespacedHelpers} from 'vuex'
const {mapState:mapCounterState,mapMutations:mapCountMutations,mapActions:mapCountActions}=createNamespacedHelpers('counter')
export default{
 computed:{
  ...mapCounterState(['count'])
 },
 methods:{
  ...mapCountMutations(['increment']),
  ...mapCountActions(['incrementAsync'])
 },
 setup(){
  return{}
 }
}
</script>

<style lang='scss' scoped>
</style>